{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "3735279d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "0.9639607542065005\n"
     ]
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYAAAAEHCAYAAACncpHfAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjUuMSwgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/YYfK9AAAACXBIWXMAAAsTAAALEwEAmpwYAAAiVElEQVR4nO3deZgV1Z3G8e87LjRGQEQMCrJoUNxB0VFpFTHoiCYxapyoqMQYNIvjEmM0JhEyI3GJjhl1ksFEcF/GZRK34NoqCipEJQouUYG0RsMiGBFwyW/+qAKb9nb3PU3XpZt+P8/Tz61bfbru25emfrfOqTqliMDMzNqff1rTAczMbM1wATAza6dcAMzM2ikXADOzdsoFwMysnXIBMDNrp1wAzMzaKRcAM7N2ygXAzKydWrepBpL2AkYCHcgKhoA/AuMjYlmx8czMrCgNFgBJVcAlwGzg7Ih4r873hgDXS7ogIqYVntLMzFqcGpoLSFJfoGtEPNvA99cH9o+I+4qLZ2ZmRWmwAKxsIJ0HlGwUET8rIpSZmRWvnEHgGuBRYCDwD2Aq8CGwe2GpzMyscE0eAaxsKE2OiOo6z5+IiCGFJTMzs0I1eRZQHTMk3Qk8D+wAvFRMJDMzq4SyjwAAJO0GbAnMiYiphaUyM7PClX0EIKkn8HWgM/CopKqIqCkqmJmZFSvlSuAbyQaEtyEbFL64iEBmZlYZKQWgA3AP8HFE/IXsTCAzM2ujUgaBJwB/ArpJuh+4rphIZmZWCamDwN2BfsDrETG/sFQN2GSTTaJv376VflkzszZr+vTp8yOie6nvpQwCnw38d0Q8nT//eUSc00IZy9K3b1+mTfPUQ2Zm5ZI0p6HvpYwBfAe4V9JO+XNfBGZm1oaljAHMBo4ErpV0czFxzMysUlKOAD6MiLeBg4Ad8VxAZmZtWtlHABHxxfzxE+B0Sb4OwMxa1EcffURtbS3LlvleU6mqqqro1asX6623Xtk/k9IFtIqIeKu5P2tmVkptbS2dOnWib9++SFrTcdqMiGDBggXU1tbSr1+/sn+uyS4gSZvmj73rf61GXjOzz1i2bBndunXzzj+RJLp165Z85FTOEcAJwAXA2HrrI/+emVmL8c6/eZrzvjVZACLigvzxG83IZGbWbH3PvqdFtzf7goNbdHttXcpZQGZmVoBnn32Wq6++epV1EydOLPx1mz0IbNamjenSzJ9b3LI5zIBBgwYxaNCgVdZNnDiRUaNGFfq65QwCf2bw14PAZrY2Wr58OUcddRRDhgzh6KOP5qKLLuL6668H4PLLL+faa6/lgw8+4IgjjmDIkCF897vfBWD27Nkcc8wxnHjiiZxwwgksWLCA4cOH8/vf/54vfelL3HXXXYwdO5aamhrOOOMMjjjiCH784x+vfN2amhrGjBkDwOLFi6murubZZ5+lurqaCy+8EIApU6YwZMgQdt11Vx544IEW+X3LOQKoP/i7ggeBzWytctVVV7Hddttx0003cd5557F06VImTZrEyJEjeeihh5g4cSLjx49nhx124LbbbuOwww5jxowZdO7cmbvuuov777+fPfbYA4APPviAF154gR49ejBz5kx22WUXAG655RZqamro379/yQxdunRh8uTJDB06lJqampXrv/Od73DHHXfQuXNnRowYwfDhw1f79y1nENiDv9Y87maxNmbmzJkcdthhAOy5557cd999LFy4kCVLlrDOOuuw0UYb8fLLL/Pkk09SU1PDokWLePPNN+ncuTMHHHDAyp0/QI8ePXj11Vfp168fkydPZuTIkbz66qscddRRDe78G/PGG2/wjW9ku+OlS5e2yO/rQWAzs9z222/P1KnZ7c6nTp3K9ttvz7777svFF1/MwQdnZxBts802nHbaadTU1DB27Fi22GILADbccMNVtjVo0CBmz55N//79+eMf/0jPnj1LtmtIx44dWbJkCSum7N9hhx246667ePDBBznmmGNa5PdNmQ66H3AE0DFftXlEnNwiKczMSqj0aZsnnngio0aNYsiQIfTp04cf/ehH1NbWMnDgQGbPng3At771LUaNGsVVV11F165duemmm1i4cOFntrXrrrvy+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csHDeufMz4nsjGZNSI/n/3yequnRsSZpdpXWmt8z0pZ0/8nXADMzNqplEFgMzNbi7gAmJm1Uy4AZmbtlAuAmVk75QJgZtZO/T/y9OI2hzQq8AAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import numpy as np\n",
    "import seaborn as sns\n",
    "import sys\n",
    "from openpyxl import Workbook\n",
    "from openpyxl.utils import get_column_letter\n",
    "import pandas as pd\n",
    "import scipy\n",
    "import os\n",
    "import sys\n",
    "import matplotlib.pyplot as plt\n",
    "from pylab import * \n",
    "import math\n",
    "from numpy import cumsum\n",
    "\n",
    "%matplotlib inline\n",
    "\n",
    "#数据输入\n",
    "def get_trace_reference(filename):\n",
    "    \n",
    "    file_base = open(filename)\n",
    "    \n",
    "    flag=0\n",
    "    \n",
    "    x = []\n",
    "    \n",
    "    while 1:\n",
    "        \n",
    "        base_lines = file_base.readlines(100000)\n",
    "             \n",
    "        if (not base_lines):\n",
    "            \n",
    "            break \n",
    "            \n",
    "        for base_line in base_lines:\n",
    "\n",
    "            if str(base_line).startswith(\"delete request average response time:\"): #以write request average response time:的行\n",
    "                number = float(base_line.split()[5]) / 1e6\n",
    "                x.append(number)\n",
    "\n",
    "    file_base.close()\n",
    "    \n",
    "    return x\n",
    "\n",
    "\n",
    "base = get_trace_reference(\"result/delete\")\n",
    "copyback = get_trace_reference(\"../draw copy/stat/test1/stat2.txt\")\n",
    "copyback_1 =[a/b for a,b in zip(copyback,base)]\n",
    "print(sum(copyback_1)/len(copyback_1))\n",
    "base_1 =[1 for _ in base]\n",
    "labels = [\"PROJ_1\",\"PROJ_3\",\"PROJ_4\",\"RSRCH\",\"SRC1_2\",\"STG_0\",\"USR_0\",\"WDEV_0\"]\n",
    "x = np.arange(len(labels))  # the label locations\n",
    "width = 0.35  # the width of the bars\n",
    "\n",
    "plt.rcParams['font.sans-serif']=['SimHei'] #用来正常显示中文标签\n",
    "plt.rcParams['axes.unicode_minus'] = False #用来正常显示负号\n",
    "fig, ax = plt.subplots()\n",
    "rects1 = ax.bar(x - width/2, base_1, width, label='overwrite')\n",
    "rects2 = ax.bar(x + width/2, copyback_1, width, label='copyback')\n",
    "\n",
    "# Add some text for labels, title and custom x-axis tick labels, etc.\n",
    "ax.set_ylabel('average deletion request response time(normalized)')\n",
    "ax.set_xticks(x)\n",
    "ax.set_xticklabels(labels)\n",
    "ax.legend()\n",
    "plt.savefig(\"write_avg.png\", bbox_inches = 'tight')\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
